package recursion;

public class Hanoi{//递归经典应用
	//static int i = 0;
	public static void main(String args[]) {
		int x = Integer.parseInt(args[0]);		
		//int x = System.in.read();
		//hanoi(x);
		System.out.println(hanoi(x));
	}

	static int hanoi(int n){
		int x = 0;
		if (n > 0){
			//hanoi(n - 1);
			//i++;
			//hanoi(n - 1);
			x = hanoi(n - 1) + 1 + hanoi(n - 1); 
		}
		return x;
	}
}      


                                                                                                                                                                   